/**
 * This file is part of iSecurePasswords.
 *
 * iSecurePasswords is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation, either version 3 of the License, or (at your option) any
 * later version.
 *
 * iSecurePasswords is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * iSecurePasswords. If not, see <http://www.gnu.org/licenses/>.
 *
 * Author: Matthew MacGregor Created: 2012 iSecurePasswords, copyright 2013
 * Sudolink, LLC
 *
 */
package com.sudolink.isp.ui;

import com.sudolink.crypto.CryptoException;
import com.sudolink.cryptodata.CryptInfoBundle;
import com.sudolink.cryptodata.ISecureData;
import com.sudolink.cryptodata.SecureData;
import com.sudolink.isp.app.Application;
import com.sudolink.isp.app.DesktopManager;
import com.sudolink.isp.cryptodata.SecureDataHelpers;
import com.sudolink.isp.ui.locktimer.ICanBeLocked;
import com.sudolink.isp.ui.menu.CopyToClipboard;
import java.awt.Color;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.JPopupMenu;
import javax.swing.SwingUtilities;
import org.apache.commons.codec.digest.DigestUtils;

public class EntryEditForm extends javax.swing.JDialog implements ICanBeLocked {

    private SecureData element;
    private EntryEditFormManager controller;
    private IRefreshData iRefreshData;
    private boolean isPasswordExpirationReset;
    /*
     * This value is used to validate that the inputs have not changed during the
     * session.  
     */
    private String checksum;
    private final String passwordChecksum;

    /**
     * Locks (hides) the dialog. 
     */
    @Override
    public void lock() {
        
        // TODO: There's a problem with this, keystrokes don't reset the timeout
        // when you're working in the EntryEditForm, and this could be pretty
        // annoying if it closes while you're trying to work. At some point, it
        // would be valuable to put some extra work into this feature.
        SwingUtilities.invokeLater(() -> {
            setVisible(false);
            Application.refreshLastUserInteractionTime();
        });
    }
    
    /**
    * Unlocks (shows) the dialog. 
    */
    @Override
    public void unlock() {
        SwingUtilities.invokeLater(() -> {
            setVisible(true);
            Application.refreshLastUserInteractionTime();
        });
    }
    
    /**
     * This method describes whether or not the dialog is active and should be
     * retained. If false, the dialog has been disposed and references should 
     * be removed so they may be garbage collected.
     * 
     * @return true if the dialog is currently available and should be retained. 
     */
    @Override
    public boolean isAvailable() {
        return isDisplayable();
    }
    
    /**
     * Creates new form EntryEditForm
     * @param element
     * @param iRefreshData
     */
    public EntryEditForm(SecureData element, IRefreshData iRefreshData) {

        initComponents();
        Application.refreshLastUserInteractionTime();
        addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
              
                String currentChecksum = generateChecksum();
                boolean shouldDispose = true;
                
                if( isEmptyEntry(currentChecksum) ) {
                    Application.getSecureDataManager().delete(element);
                }
                
                if (controller.validateChecksums(checksum, currentChecksum) != true) {
                    int result = JOptionPane.showConfirmDialog(EntryEditForm.this, 
                            "Are you sure you want to close? Your changes will be lost.");

                    if (result == JOptionPane.YES_OPTION) {
                        if( isEmptyEntry(checksum) ) {
                            Application.getSecureDataManager().delete(element);
                        }
                    } else {
                        shouldDispose = false;
                    }
                } 
                    
                if( shouldDispose ) {
                    EntryEditForm.this.dispose();
                }
                
            }
        });

        controller = new EntryEditFormManager();

        this.element = element;
        this.iRefreshData = iRefreshData;
        
        initializeEntryFields();

        userNameField.addMouseListener(new MouseAdapter() {
            @Override
            public void mousePressed(MouseEvent e) {

                //For Mac OS Platform (Unix?)
                if (e.isPopupTrigger()) {
                    doPop(e);
                }
            }

            @Override
            public void mouseReleased(MouseEvent e) {
                //For Windows Platform
                if (e.isPopupTrigger()) {
                    doPop(e);
                }
            }

            private void doPop(MouseEvent e) {
                JPopupMenu menu = new JPopupMenu();
                CopyToClipboard copyToClipboard = new CopyToClipboard(userNameField.getText(), "Copy User Name to Clipboard");
                copyToClipboard.willClearClipboard(false);
                menu.add(copyToClipboard);
                menu.show(e.getComponent(), e.getX(), e.getY());

            }
        });

        passwordField.setEditable(false);
        passwordField.addMouseListener(new MouseAdapter() {
            CopyToClipboard copyToClipboard;

            @Override
            public void mousePressed(MouseEvent e) {
                //For Mac Platform (Unix?)
                if (e.isPopupTrigger()) {
                    doPop(e);
                }

            }

            @Override
            public void mouseReleased(MouseEvent e) {
                //For Windows Platform
                if (e.isPopupTrigger()) {
                    doPop(e);
                }
            }

            private void doPop(MouseEvent e) {
                JPopupMenu menu = new JPopupMenu();

                copyToClipboard = new CopyToClipboard(new String(passwordField.getPassword()), "Copy Password To Clipboard");
                // TODO: Callback does nothing?
                copyToClipboard.setUICallback((String e1) -> {});
                menu.add(copyToClipboard);
                menu.show(e.getComponent(), e.getX(), e.getY());
            }
        });

        if (SecureDataHelpers.isPasswordExpired(element)) {
            lblNotificationArea.setText("You should consider changing this password.");
            lblNotificationArea.setForeground(Color.red);
        }

        DesktopManager dm = new DesktopManager();
        if (dm.isBrowserLaunchSupported() == false) {
            btnLaunchBrowser.setEnabled(false);
        }

        this.setModal(true);
        this.setLocationRelativeTo(null);
        this.pack();

        /**
         * The last thing that we'll initialize is setting a checksum on all of
         * the values of the fields. This will allow us to see if anything has
         * changed.
         */
        checksum = generateChecksum();
        /*
         * Now Generate the checksum for just the password field.  We want to 
         * check if it has changed.
         */
        passwordChecksum = generatePasswordChecksum();


    }

    /*
    * Initializes the data entry fields in the dialog, unless there is an 
    * exception.
    */
    private void initializeEntryFields(){
        
        CryptInfoBundle b = Application.getPrivateKeys();
        entryNameField.setText(element.get(ISecureData.ENTRYNAME, b));
        userNameField.setText(element.get(ISecureData.USERNAME, b));
        urlField.setText(element.get(ISecureData.URL, b));
        passwordField.setText(element.get(ISecureData.PASSWORD, b));
        notesField.setText(element.get(ISecureData.NOTES, b));

        long expireTime = SecureDataHelpers.getLong(
                element, ISecureData.PASSWORD_EXPIRE_TIMESPAN_MS, 0);

        if (expireTime > 0) {
            int index = controller.convertMillisecondExpirationToIndex(expireTime);
            comboExpirationTime.setSelectedIndex(index);
        } else {
            comboExpirationTime.setSelectedIndex(1);
        }

        boolean isPwExpiratioEnabled = SecureDataHelpers.getBoolean(
                        element, ISecureData.PASSWORD_REMINDER_ENABLED, true);
        cbPwReminderEnabled.setSelected(isPwExpiratioEnabled);

        boolean isEntryArchived = SecureDataHelpers.getBoolean(
                                    element, ISecureData.IS_ARCHIVED, false);
        cbArchived.setSelected(isEntryArchived);

    }

    /**
     * This method verifies that the checksum is not identical from the checksum
     * for an unmodified element. Note that if new data is added to the checksum,
     * this value must be updated as well. The method is used to make sure that
     * "new" elements which contain no data are not added to the list of elements.
     * 
     * TODO: Improve this in the future. This is pretty kludgy.
     * 
     * @param checksum
     * @return True if the entry has not been modified.
     */
    private boolean isEmptyEntry(String checksum) {
        return (checksum.equals("31dd7922b6ebf73b3a7695fb20dc7f87eb0ea941"));
    }
    
    /**
     * Used to check if any of the inputs have changed and need to be saved.
     *
     * @return
     */
    private String generateChecksum() {
        StringBuilder validate = new StringBuilder();
        String pwHex = generatePasswordChecksum();
        validate.append(userNameField.getText());
        validate.append(notesField.getText());
        validate.append(urlField.getText());
        validate.append(entryNameField.getText());
        validate.append(cbPwReminderEnabled.isSelected());
        validate.append(comboExpirationTime.getSelectedIndex());
        validate.append(pwHex);
        validate.append(isPasswordExpirationReset);
        String cs = controller.generateChecksum(validate.toString());
        return cs;
    }

    /**
     * Generates a Sha1 checksum as a hex string from the password field.
     *
     */
    private String generatePasswordChecksum() {
        byte[] bpw = com.matsuzine.utils.HelperMethods.convertCharArrayToByteArray(passwordField.getPassword());
        String pwHex = DigestUtils.shaHex(bpw);
        com.matsuzine.utils.HelperMethods.clearArray(bpw);
        return pwHex;
    }

    /**
     * Compares the old password and the new password. Will return true if the
     * new and old passwords are different.
     */
    private boolean isPasswordChanged() {
        String newPasswordChecksum = generatePasswordChecksum();
        return !(newPasswordChecksum.equals(passwordChecksum));
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTextField1 = new javax.swing.JTextField();
        tabSettings = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jPanel4 = new javax.swing.JPanel();
        userNameField = new javax.swing.JTextField();
        jPanel9 = new javax.swing.JPanel();
        jLabel7 = new javax.swing.JLabel();
        jPanel5 = new javax.swing.JPanel();
        passwordField = new javax.swing.JPasswordField();
        btnShowPassword = new javax.swing.JToggleButton();
        btnGeneratePassword = new javax.swing.JButton();
        btnPwLock = new javax.swing.JToggleButton();
        jPanel10 = new javax.swing.JPanel();
        jLabel8 = new javax.swing.JLabel();
        jPanel6 = new javax.swing.JPanel();
        urlField = new javax.swing.JTextField();
        btnLaunchBrowser = new javax.swing.JButton();
        jPanel11 = new javax.swing.JPanel();
        jLabel9 = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        notesField = new javax.swing.JEditorPane();
        jPanel7 = new javax.swing.JPanel();
        entryNameField = new javax.swing.JTextField();
        jPanel8 = new javax.swing.JPanel();
        jLabel6 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        applyButton = new javax.swing.JButton();
        lblNotificationArea = new javax.swing.JLabel();
        jPanel12 = new javax.swing.JPanel();
        panelPasswordReminder = new javax.swing.JPanel();
        cbPwReminderEnabled = new javax.swing.JCheckBox();
        comboExpirationTime = new javax.swing.JComboBox();
        jLabel2 = new javax.swing.JLabel();
        btnReset = new javax.swing.JButton();
        jPanel13 = new javax.swing.JPanel();
        applyButton2 = new javax.swing.JButton();
        panelArchived = new javax.swing.JPanel();
        cbArchived = new javax.swing.JCheckBox();

        jTextField1.setText("jTextField1");

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setTitle("iSecurePasswords");
        setBackground(new java.awt.Color(127, 157, 185));
        setName("entryEditFrame"); // NOI18N
        setResizable(false);

        jPanel1.setBackground(new java.awt.Color(185, 209, 234));

        jPanel4.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(153, 153, 153), 1, true));

        jPanel9.setPreferredSize(new java.awt.Dimension(65, 36));

        jLabel7.setFont(new java.awt.Font("Lucida Grande", 0, 10)); // NOI18N
        jLabel7.setText("Username");

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel7)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(userNameField)
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(userNameField)
                    .addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        jPanel5.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(153, 153, 153), 1, true));

        passwordField.setFont(new java.awt.Font("Courier", 0, 12)); // NOI18N
        passwordField.setEchoChar('*');

        btnShowPassword.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/sudolink/isp/media/eye.png"))); // NOI18N
        btnShowPassword.setToolTipText("Reveal Password");
        btnShowPassword.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                btnShowPasswordStateChanged(evt);
            }
        });

        btnGeneratePassword.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/sudolink/isp/media/key.png"))); // NOI18N
        btnGeneratePassword.setToolTipText("Generate Password");
        btnGeneratePassword.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnGeneratePasswordActionPerformed(evt);
            }
        });

        btnPwLock.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/sudolink/isp/media/lock.png"))); // NOI18N
        btnPwLock.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnPwLockActionPerformed(evt);
            }
        });

        jPanel10.setPreferredSize(new java.awt.Dimension(65, 36));

        jLabel8.setFont(new java.awt.Font("Lucida Grande", 0, 10)); // NOI18N
        jLabel8.setText("Password");

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel8)
                .addContainerGap(12, Short.MAX_VALUE))
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel8)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(passwordField)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnShowPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnPwLock, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnGeneratePassword, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(btnGeneratePassword, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(btnPwLock, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(jPanel5Layout.createSequentialGroup()
                                .addGap(1, 1, 1)
                                .addComponent(passwordField))
                            .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(0, 1, Short.MAX_VALUE))
                    .addComponent(btnShowPassword, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        jPanel6.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(153, 153, 153), 1, true));

        btnLaunchBrowser.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/sudolink/isp/media/world.png"))); // NOI18N
        btnLaunchBrowser.setToolTipText("Launch Url in a Browser");
        btnLaunchBrowser.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnLaunchBrowserActionPerformed(evt);
            }
        });

        jPanel11.setPreferredSize(new java.awt.Dimension(65, 36));

        jLabel9.setFont(new java.awt.Font("Lucida Grande", 0, 10)); // NOI18N
        jLabel9.setText("Url");

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, 45, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel9)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(urlField)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnLaunchBrowser, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(urlField, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel11, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btnLaunchBrowser, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        jPanel3.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(153, 153, 153), 1, true));

        jLabel1.setFont(new java.awt.Font("Lucida Grande", 0, 10)); // NOI18N
        jLabel1.setText("Notes");

        jScrollPane1.setViewportView(notesField);

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 121, Short.MAX_VALUE)
                .addContainerGap())
        );

        jPanel7.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(153, 153, 153), 1, true));

        jPanel8.setPreferredSize(new java.awt.Dimension(65, 38));

        jLabel6.setFont(new java.awt.Font("Lucida Grande", 0, 10)); // NOI18N
        jLabel6.setText("Name");

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel6)
                .addContainerGap(27, Short.MAX_VALUE))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel6)
                .addContainerGap(13, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(entryNameField)
                .addContainerGap())
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(entryNameField, javax.swing.GroupLayout.DEFAULT_SIZE, 38, Short.MAX_VALUE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel2.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(153, 153, 153), 1, true));

        applyButton.setText("Apply");
        applyButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                applyButtonActionPerformed(evt);
            }
        });

        lblNotificationArea.setText("  ");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lblNotificationArea, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(applyButton)
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(applyButton, javax.swing.GroupLayout.DEFAULT_SIZE, 56, Short.MAX_VALUE)
                    .addComponent(lblNotificationArea))
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel7, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        tabSettings.addTab("General", jPanel1);

        panelPasswordReminder.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Password Reminder", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(102, 102, 102))); // NOI18N

        cbPwReminderEnabled.setSelected(true);
        cbPwReminderEnabled.setText("Enable Password Reminder");

        comboExpirationTime.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "30 Days", "90 Days", "120 Days", "180 Days", "365 Days" }));

        jLabel2.setText("Password expires after:");

        btnReset.setText("Reset");
        btnReset.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnResetActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout panelPasswordReminderLayout = new javax.swing.GroupLayout(panelPasswordReminder);
        panelPasswordReminder.setLayout(panelPasswordReminderLayout);
        panelPasswordReminderLayout.setHorizontalGroup(
            panelPasswordReminderLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelPasswordReminderLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelPasswordReminderLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelPasswordReminderLayout.createSequentialGroup()
                        .addComponent(cbPwReminderEnabled, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnReset))
                    .addComponent(comboExpirationTime, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        panelPasswordReminderLayout.setVerticalGroup(
            panelPasswordReminderLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelPasswordReminderLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelPasswordReminderLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(cbPwReminderEnabled)
                    .addComponent(btnReset))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(comboExpirationTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel13.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(153, 153, 153), 1, true));

        applyButton2.setText("Apply");
        applyButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                applyButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
        jPanel13.setLayout(jPanel13Layout);
        jPanel13Layout.setHorizontalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel13Layout.createSequentialGroup()
                .addContainerGap(320, Short.MAX_VALUE)
                .addComponent(applyButton2)
                .addContainerGap())
        );
        jPanel13Layout.setVerticalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel13Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(applyButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        panelArchived.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Archived", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(102, 102, 102))); // NOI18N

        cbArchived.setText("Is Archived (This will hide the entry)");

        javax.swing.GroupLayout panelArchivedLayout = new javax.swing.GroupLayout(panelArchived);
        panelArchived.setLayout(panelArchivedLayout);
        panelArchivedLayout.setHorizontalGroup(
            panelArchivedLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelArchivedLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(cbArchived, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        panelArchivedLayout.setVerticalGroup(
            panelArchivedLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelArchivedLayout.createSequentialGroup()
                .addComponent(cbArchived, javax.swing.GroupLayout.DEFAULT_SIZE, 31, Short.MAX_VALUE)
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
        jPanel12.setLayout(jPanel12Layout);
        jPanel12Layout.setHorizontalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(panelPasswordReminder, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel13, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(panelArchived, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel12Layout.setVerticalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(panelPasswordReminder, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(panelArchived, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(219, 219, 219)
                .addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        tabSettings.addTab("Settings", jPanel12);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(tabSettings)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(tabSettings)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void applyButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_applyButtonActionPerformed

        if (!controller.validateEntryNameField(entryNameField.getText())) {
            JOptionPane.showMessageDialog(this, "You must provide an entry name.");
            return;
        }

        CryptInfoBundle bundle = Application.getPrivateKeys();

        //Not secure!
        //String password = new String(passwordField.getPassword());
        char[] password = passwordField.getPassword();

        if (isPasswordChanged()) {
            long datetime = new Date().getTime();
            element.set(ISecureData.LAST_PASSWORD_RESET_TIME, datetime + "", bundle);
        }

        element.set(ISecureData.ENTRYNAME, entryNameField.getText().toCharArray(), bundle);
        element.set(ISecureData.USERNAME, userNameField.getText().toCharArray(), bundle);
        element.set(ISecureData.URL, urlField.getText().toCharArray(), bundle);
        element.set(ISecureData.PASSWORD, password, bundle);
        element.set(ISecureData.NOTES, notesField.getText().toCharArray(), bundle);

        long ms = controller.convertIndexToMillisecondExpiration(comboExpirationTime.getSelectedIndex());
        element.set(ISecureData.PASSWORD_EXPIRE_TIMESPAN_MS, Long.toString(ms), bundle);
        element.set(ISecureData.PASSWORD_REMINDER_ENABLED, String.valueOf(cbPwReminderEnabled.isSelected()), bundle);
        element.set(ISecureData.IS_ARCHIVED, String.valueOf(cbArchived.isSelected()), bundle);
        element.setName(entryNameField.getText());

        controller.saveData(element, password);
        dispose();
        iRefreshData.refreshData();

    }//GEN-LAST:event_applyButtonActionPerformed

    private void btnShowPasswordStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_btnShowPasswordStateChanged

        if (btnShowPassword.isSelected()) {
            passwordField.setEchoChar((char) 0);
        } else {
            passwordField.setEchoChar('*');
        }
        //passwordField.setText(element.getValue(Constants.PASSWORD));
    }//GEN-LAST:event_btnShowPasswordStateChanged

    private void btnPwLockActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPwLockActionPerformed

        controller.togglePasswordLockState(btnPwLock, passwordField);

    }//GEN-LAST:event_btnPwLockActionPerformed

    private void btnLaunchBrowserActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLaunchBrowserActionPerformed
        try {
            controller.launchBrowser(urlField.getText());
        } catch (URISyntaxException | IOException ex) {
            Logger.getLogger(EntryEditForm.class.getName()).log(Level.SEVERE, null, ex);
            JOptionPane.showMessageDialog(this, "The url is not valid.");
        }
    }//GEN-LAST:event_btnLaunchBrowserActionPerformed

    private void btnGeneratePasswordActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGeneratePasswordActionPerformed

        PasswordGenerator pwGenerator = new PasswordGenerator();
        if (passwordField.getPassword().length == 0) {
            pwGenerator.isNewPassword(true);
        }
        pwGenerator.setLocationRelativeTo(this);
        pwGenerator.setVisible(true);
        pwGenerator.setModal(true);

        //Freezes here b/c its modal
        passwordField.setText(new String(pwGenerator.getPassword()));

    }//GEN-LAST:event_btnGeneratePasswordActionPerformed

    private void btnResetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnResetActionPerformed
        CryptInfoBundle bundle = Application.getPrivateKeys();
        long datetime = new Date().getTime();
        element.set(ISecureData.LAST_PASSWORD_RESET_TIME, datetime + "", bundle);
        isPasswordExpirationReset = true;

    }//GEN-LAST:event_btnResetActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton applyButton;
    private javax.swing.JButton applyButton2;
    private javax.swing.JButton btnGeneratePassword;
    private javax.swing.JButton btnLaunchBrowser;
    private javax.swing.JToggleButton btnPwLock;
    private javax.swing.JButton btnReset;
    private javax.swing.JToggleButton btnShowPassword;
    private javax.swing.JCheckBox cbArchived;
    private javax.swing.JCheckBox cbPwReminderEnabled;
    private javax.swing.JComboBox comboExpirationTime;
    private javax.swing.JTextField entryNameField;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JLabel lblNotificationArea;
    private javax.swing.JEditorPane notesField;
    private javax.swing.JPanel panelArchived;
    private javax.swing.JPanel panelPasswordReminder;
    private javax.swing.JPasswordField passwordField;
    private javax.swing.JTabbedPane tabSettings;
    private javax.swing.JTextField urlField;
    private javax.swing.JTextField userNameField;
    // End of variables declaration//GEN-END:variables


}
